﻿#include "Application.h"
#include "CreateSystemAction.h"
#include "System.h"


void CreateSystemAction::Execute()
{
  _parser.SetPrefix("System/");

  Configuration cfg;
  cfg.Add<Application*>("_app", &_app);
  cfg.Add<Parser*>("_parser", &_parser);
  auto type = cfg.Get<std::string>("type");

  _app.GetSystem() = Object::Make<System>(type, cfg);
  
  Success("CreateSystemAction");
}
